package mytest.wd2;

import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;

import java.util.HashMap;
import java.util.Map;

public class Test7 {

    public static void main(String[] args) {
        String s1 = "{\n" +
                "      \"userInfo\": \"8138498077\",\n" +
                "      \"userInfoType\": \"phone\",\n" +
                "      \"vendor\": \"nigeria\",\n" +
                "      \"bizType\": \"alend\",\n" +
                "      \"flag\": \"pre_credit\",\n" +
                "      \"state\": \"0\",\n" +
                "      \"batch\": \"\",\n" +
                "      \"time\": \"1722844097076\",\n" +
                "      \"extra\": \"{\\\"amount\\\":\\\"50000\\\"}\"\n" +
                "    }";

        Map<String, Object> map = JSONObject.parseObject(s1);
        String s2 = (String) map.get("extra");
        Map<String, Object> map1 = JSONObject.parseObject(s2);
        System.out.println(map1.get("amount"));

    }

}
